<?php
/**
 * Sistema Apicola
 * Modelo de Problema
 */
class Problema extends AppModel {

    var $name = 'Problema';

    var $useTable = 'problemas';
    var $primaryKey = 'id';
    var $displayField = 'desc_prob_prod';
    var $recursive = 0;
    var $order=array(
        'Problema.desc_prob_prod'=>'ASC'
    );

    var $validate = array();

    var $belongsTo = array(
        'Problemastipo' => array(
            'className' => 'Problemastipo',
            'foreignKey' => 'problemastipo_id'
        ),
        'Revision' => array(
            'className' => 'Revision',
            'foreignKey' => 'revision_id'
        )
    );

    public function beforeSave(){
        if(!empty($this->data['Problema'])){
            foreach($this->data['Problema'] as $campo=>$valor){
                $this->data['Problema'][$campo]=strtoupper($valor);
            }
        }
        return true;
    }
}
?>